/**
 *
 */
package ar.com.mun.export;

import ar.com.mun.beans.Expediente;

import com.angel.io.exceptions.InvalidRowDataException;
import com.angel.io.processors.commands.exports.ExportRowProcessorCommand;
import com.angel.io.type.rows.ExportRowFile;
import com.angel.io.type.rows.impl.HeaderRowFile;

/**
 * @author William
 *
 */
public class ExpedienteExportRowProcessorCommand implements ExportRowProcessorCommand{

	public static final String NOMBRE_MUNICIPALIDAD_COLUMN = "municipalidad";
	public static final String NUMERO_COLUMN = "numero";
	public static final String CREADOR_COLUMN = "creador";
	public static final String NOMBRE_MOTIVO_COLUMN = "nombreMotivo";
	public static final String ALCANCE_COLUMN = "alcance";

	public void checkHeader(HeaderRowFile headerRowFile) throws InvalidRowDataException {
		
	}

	public void processRow(ExportRowFile exportRowFile, Object toExport, HeaderRowFile headerRowFile) throws InvalidRowDataException {
		Expediente expedienteToExport = (Expediente) toExport;
		exportRowFile.addStringValue(expedienteToExport.getMunicipalidad().getNombre(), headerRowFile.getColumnPosition(NOMBRE_MUNICIPALIDAD_COLUMN));
		exportRowFile.addStringValue(expedienteToExport.getNumero(), headerRowFile.getColumnPosition(NUMERO_COLUMN));
		exportRowFile.addStringValue(expedienteToExport.getCreador(), headerRowFile.getColumnPosition(CREADOR_COLUMN));
		exportRowFile.addIntegerValue(expedienteToExport.getAlcance(), headerRowFile.getColumnPosition(ALCANCE_COLUMN));		
	}

}
